package com.stellar.circle.basic.service.impl;

import com.stellar.circle.basic.dao.SPostDao;
import com.stellar.circle.basic.entity.SPost;
import com.stellar.circle.basic.service.SPostService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
import java.util.Set;

/**
 * 校园墙帖子表(SPost)服务实现
 *
 * @author Jqchan
 * @since 2025-05-17 19:23:35
 */
@Service
public class SPostServiceImpl implements SPostService {
    
    @Resource
    private SPostDao sPostDao;

    @Override
    public SPost queryById(Long id) {
        return sPostDao.queryById(id);
    }

    @Override
    public SPost queryByCondition(SPost condition) {
        return sPostDao.queryByCondition(condition);
    }

    @Override
    public List<SPost> queryAllByCondition(SPost condition) {
        return sPostDao.queryAllByCondition(condition);
    }

    @Override
    public List<SPost> page(SPost condition, int page, int pageSize) {
        return sPostDao.page(condition, page, pageSize);
    }

    @Override
    public int insert(SPost entity) {
        return sPostDao.insert(entity);
    }

    @Override
    public int update(SPost entity) {
        return sPostDao.update(entity);
    }

    @Override
    public int deleteById(Long id) {
        return sPostDao.deleteById(id);
    }

    @Override
    public Long count(SPost condition) {
        return sPostDao.count(condition);
    }

    @Override
    public int view(Long postId) {
        return sPostDao.view(postId);
    }

    @Override
    public List<SPost> batchQueryByIds(Set<Long> postIds) {
        return sPostDao.batchQueryByIds(postIds);
    }

    @Override
    public void updateCommentCount(Long sourceId, int delta) {
        sPostDao.updateCommentCount(sourceId, delta);
    }
}
